package main

import (
	"fmt"
	"go-base-learning/src/14_object_oriented/package/model"
)

type A struct {
	Name string
	age  int
}

func (a *A) SayHello() {
	fmt.Println("A Hello", a.Name)
}

func (a *A) sayOk() {
	fmt.Println("A ok", a.Name)
}

type B struct {
	A
}

type C struct {
	Name  string
	Score int
}

type D struct {
	A
	C
}

type E struct {
	a A
}

type F struct {
	*A
}

func main() {
	var b B
	b.Name = "Jack"
	b.age = 20
	b.SayHello()
	b.sayOk()
	fmt.Println(b.age)

	var p model.Pupil
	p.Name = "Tom"
	p.SayHello()

	var d D
	d.A.Name = "Mark"

	var e E
	e.a.Name = "Jay"

	var f = F{
		&A{
			Name: "asd",
			age:  1,
		},
	}
	fmt.Println("f", f)
	fmt.Println("f", *f.A)
}
